﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using CastleOfTheDisillusioned.Enemies;

namespace CastleOfTheDisillusioned.Location.Maps.Forrest {
	class ZombieCell : Cell {
		public ZombieCell(double X, double Y, double Width, double Height) {
			this.X = X;
			this.Y = Y;
			this.Width = Width;
			this.Height = Height;
			
			//Floor
			this.AddTileRow(0, Height - 1, (int)Width);

			//Trees
			for (int i = Program.Random.Next(12, 24); i < Width; i += Program.Random.Next(12, 24)) {
				this.AddEntity(new Entities.Tree(i, Height - 1));
				//int TreeHeight = Program.Random.Next(9, 15);
				//this.AddTree(i, (int)Height - TreeHeight - 1, TreeHeight);
			}

			this.AddEnemy(new Wolf(13, Height - 2));
		}

		public override void Update() {
			base.Update();

			if (Program.Random.Next(120) == 0) {
				this.AddEnemy(new Zombie(Program.Random.Next(1, (int)Width - 2), 17));
			}
		}

		//private void AddTree(int X, int Y, int Height) {
		//    //Add leaves
		//    AddTile(new ColorTile(X - 4, Y - 4, 9, 9, Color.Green));

		//    //Add trunk
		//    AddTile(new ColorTile(X, Y, 1, Height, Color.FromArgb(90, 45, 20)));

		//    //Add some arms
		//    int numarms = Program.Random.Next(0, Height / 3);
		//    for (int i = 0; i < numarms; i++) {
		//        double armlength = (Program.Random.NextDouble() * 3) + 1;
		//        int ArmSide = Program.Random.Next(2);

		//        FallThroughTile t = new FallThroughTile(X, Y);
		//        t.Width = armlength;
		//        t.X = ArmSide == 0 ? (X - armlength) : X + 1;
		//        t.Y = Program.Random.Next(Y + 3, Y + Height - 3);
		//        t.Y += Program.Random.NextDouble();
		//        this.AddTile(t);
		//    }
		//}
	}
}
